var dbutility = require('../common/dbutility');

var couModel = dbutility.couModel;
var expModel = dbutility.expModel;
var cabModel = dbutility.cabModel;
var msgModel = dbutility.msgModel;

msgModel.remove({}, function(err, doc) {
    console.log(err);
    console.log(doc);
});

expModel.remove({}, function(err, doc) {
    console.log(err);
    console.log(doc);
});

couModel.remove({}, function() {
    couModel.create({ couName: '管理员', couTel: '18888888880', couCmp: '9999', couPwd: 'BD02D5D39E0B2037247F0339987EE894' }, function(err, doc) {
        if (err) {
            console.log(err);
        } else {
            console.log(doc);
        }
    });
    couModel.create({ couName: '快递员', couTel: '18888888881', couCmp: '顺丰', couPwd: 'C8F85FFA3ED552CB755EE924C0304588' }, function(err, doc) {
        if (err) {
            console.log(err);
        } else {
            console.log(doc);
        }
    });
});

cabModel.remove({}, function(error, doc) {
    cabModel.create({ cabNo: '1-1-13', cabType: '大号', cabInUse: false, cabPwd: null, cabPortName: 'COM10', cabOpenCmd: 'AA 55 01 01 00 01 00', cabCheckCmd: 'AA 55 01 00 00 01 00', cabOpenStatus: 'FF 00 FF 00 FE 00' }, function(error, doc) {
        console.log(error);
        console.log(doc);
    });
    cabModel.create({ cabNo: '1-1-14', cabType: '大号', cabInUse: false, cabPwd: null, cabPortName: 'COM10', cabOpenCmd: 'AA 55 01 01 00 01 00', cabCheckCmd: 'AA 55 01 00 00 01 00', cabOpenStatus: 'FF 00 FF 00 FE 00' }, function(error, doc) {
        console.log(error);
        console.log(doc);
    });
    cabModel.create({ cabNo: '1-1-15', cabType: '小号', cabInUse: false, cabPwd: null, cabPortName: 'COM10', cabOpenCmd: 'AA 55 01 01 00 01 00', cabCheckCmd: 'AA 55 01 00 00 01 00', cabOpenStatus: 'FF 00 FF 00 FE 00' }, function(error, doc) {
        console.log(error);
        console.log(doc);
    });
    cabModel.create({ cabNo: '1-1-16', cabType: '小号', cabInUse: false, cabPwd: null, cabPortName: 'COM10', cabOpenCmd: 'AA 55 01 01 00 01 00', cabCheckCmd: 'AA 55 01 00 00 01 00', cabOpenStatus: 'FF 00 FF 00 FE 00' }, function(error, doc) {
        console.log(error);
        console.log(doc);
    });
    cabModel.create({ cabNo: '1-1-17', cabType: '中号', cabInUse: false, cabPwd: null, cabPortName: 'COM10', cabOpenCmd: 'AA 55 01 01 00 01 00', cabCheckCmd: 'AA 55 01 00 00 01 00', cabOpenStatus: 'FF 00 FF 00 FE 00' }, function(error, doc) {
        console.log(error);
        console.log(doc);
    });
    cabModel.create({ cabNo: '1-1-18', cabType: '中号', cabInUse: false, cabPwd: null, cabPortName: 'COM10', cabOpenCmd: 'AA 55 01 01 00 01 00', cabCheckCmd: 'AA 55 01 00 00 01 00', cabOpenStatus: 'FF 00 FF 00 FE 00' }, function(error, doc) {
        console.log(error);
        console.log(doc);
    });
});